package com.whcoding.mybatis.plus.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.whcoding.mybatis.plus.entity.OrmDeptVO;
import com.whcoding.mybatis.plus.mapper.OrmDeptMapper;
import com.whcoding.mybatis.plus.service.OrmDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: spring-boot-learning
 * @description:
 * @author: whcoding
 * @create: 2022-08-10 16:07
 **/
@Service
public class OrmDeptServiceImpl extends ServiceImpl<OrmDeptMapper, OrmDeptVO> implements OrmDeptService {


	@Autowired
	OrmDeptMapper deptMapper;

	/**
	 * 测试Mybatis plus
	 */
	@Override
	public void tempDept() {
		//1. 分页查询数据
		Page<OrmDeptVO> page = new Page<>(1, 5);
		deptMapper.selectPage(page, null);

		//2. 自定义SQL查询数据
		List<OrmDeptVO> list = deptMapper.listDept();
	}
}
